<template>
    <view class="header-container">
        <view class="back-container" v-show="showBack === 'true'" @click="goBack">
            <image src="@/static/img/back.png"></image>
        </view>
        <text>{{ title }}</text>
    </view>
</template>

<script setup>
import { onBeforeMount, onMounted, ref } from 'vue';
import { onReady } from '@dcloudio/uni-app';
const props = defineProps({
    title: String,
    showBack: {
        type: String,
        default: 'false'
    }
});
const emit = defineEmits(['onBackPress']);
function goBack() {
    uni.navigateBack();
}
</script>

<style lang="scss" scoped>
@import '/static/css/common.scss';
.header-container {
    @extend .row-layout;
    height: $scale * 60rpx;
    padding: $scale * 10rpx;
    background-color: #437eff;
    position: relative;
    justify-content: center;
    align-items: center;
    .back-container {
        @extend .row-layout;
        width: auto;
        padding: $scale * 15rpx;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        image {
            width: $scale * 16rpx;
            height: $scale * 16rpx;
        }
    }
    text {
        color: white;
        font-size: $scale * 20rpx;
    }
}
</style>
